package com.zhuzi.exception;

public enum ErrorCode {

	OK(0, "成功"), 

	Internal_Server_Error(500, "服务错误"), 

	BAD_REQUEST(400, "请求出错"),

	Resource_Forbidden(403, "禁止访问"),

	Resource_Not_Found(404, "请求地址错误"),

	Method_Not_Allowed(405, "方法不允许访问"),

	Paramter_Error(501, "参数错误"),

	Data_Error(502, "数据错误"),
	
	Send_Sms_Error(1007, "发送短信失败"),
	
	Login_Code_Error(1008, "登录验证码错误"),
	
	Token_Error(1009, "token错误或已失效"),
	
	Mobile_Has_Been_Bind(1011, "该手机已经被绑定"),
	
	MgrUser_Not_Exist(1034, "MgrUser用户不存在"),
	
	WXUser_NotExist(1035,"微信用户不存在"),
	
	InvestorUser_NotExist(1036,"投资人用户不存在"),
	
	Subscribe_Exist(1037,"已认购"),
	
	Company_NotExist(1038,"管理公司不存在"),
	
	Focus_Same(1039,"关注与被关注是同一人"),
	
	FocusInfo_NotExist(1040,"关注信息不存在"),
	
	User_NotExist(1041,"用户不存在")
	;


	public Integer value;

	public String memo;

	ErrorCode(Integer value, String memo) {
		this.value = value;
		this.memo = memo;
	}

	public static String getMemoByValue(Integer value) {
		if (value == null) {
			return "";
		}
		for (ErrorCode errorCode : ErrorCode.values()) {
			if (errorCode.value.equals(value)) {
				return errorCode.memo;
			}
		}
		return "";
	}

}
